package com.cn.wanxi.mapper;

import com.cn.wanxi.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    //    @Select("SELECT * FROM user where username=#{username} and password =#{password}")
    User findByUsernameAndPassword(User user);

//    @Insert("INSERT INTO `user` (" +
//            "`username`, `address`, `create_time`," +
//            " `email`, `enable`, `password`," +
//            " `phone`, `sex`, `update_time`," +
//            " `hobby`, `birthday`, `remark`) VALUES (" +
//            "#{username},#{address},now()," +
//            "#{email},#{enable},#{password}," +
//            "#{phone},#{sex},now()," +
//            "#{hobby},#{birthday},#{remark})")
    int add(User user);

    int update(User user);

    int del(User user);

    List<User> findAll(User user);

    int getCount(User user);

    User findById(User user);

}
